//
//  SettingGroupModel.m
//  AutoMate
//
//  Created by hao on 2018/3/1.
//  Copyright © 2018年 songlei. All rights reserved.
//

#import "SettingGroupModel.h"

@implementation SettingGroupModel

+ (instancetype)settingGroupModelWithItems:(NSArray<SettingItemModel *> *)items
{
    return [[self alloc] initWithSettingItems:items];
}

- (instancetype)initWithSettingItems:(NSArray<SettingItemModel *> *)items
{
    if (self = [super init]) {
        self.itemsArr = items.mutableCopy;
        self.groupHeadHeight = 0.000001;
        self.groupFootHeight = 0.000001;
    }
    return self;
}

+ (instancetype)settingGroupModelWithItems:(NSArray<SettingItemModel *> *)items
                                 headTitle:(NSString *)headTitle
                                headHeight:(CGFloat)headHeight
                                 footTitle:(NSString *)footTitle
                                footHeight:(CGFloat)footHeight
{
    SettingGroupModel *model = [SettingGroupModel settingGroupModelWithItems:items];
    model.groupHeadTitle = headTitle;
    model.groupFootTitle = footTitle;
    model.groupHeadHeight = headHeight;
    model.groupFootHeight = footHeight;
    return model;
}

+ (instancetype)settingGroupModelWithItems:(NSArray<SettingItemModel *> *)items
                                  headView:(UIView *)headView
                                headHeight:(CGFloat)headHeight
                                  footView:(UIView *)footView
                                footHeight:(CGFloat)footHeight
{
    SettingGroupModel *model = [SettingGroupModel settingGroupModelWithItems:items];
    model.groupHeadView = headView;
    model.groupFootView = footView;
    model.groupHeadHeight = headHeight;
    model.groupFootHeight = footHeight;
    return model;
}

@end
